Vehicle Class Reference

#include <Vehicle.h>

Inheritance diagram for Vehicle:

TraffEduObject List of all members.

Public Member Functions

 Vehicle ()
 Vehicle (string pathname, float scale)
void draw (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
void deletePath ()
Path * getPath ()
void setPath ()
void hidePath (osg::ref_ptr< osg::Group > root)
void displayPath (osg::ref_ptr< osg::Group > root)
void drawPath (osg::ref_ptr< osg::Group > root)
void reload (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
void setWheels (osg::ref_ptr< osg::Group > root)
void setPositionAll (float x, float y, float z)

Public Attributes

Wheel wheelObjects [4]

Private Attributes

Path path

Detailed Description

A class to implement one type of TraffEduObject, that is Vehicle.

Definition at line 5 of file Vehicle.h.


Constructor & Destructor Documentation

Vehicle::Vehicle (   ) 
 

A constructor. default constructor.

Definition at line 1 of file Vehicle.cpp.

References OSGWindows::getFrames(), TraffEduObject::objectGeode, TraffEduObject::objectGroup, TraffEduObject::objectPAT, TraffEduObject::objectPATvector, osgwind, TraffEduObject::setObjectType(), OSGWindows::sizeOfFrames(), and VEHICLE.

Vehicle::Vehicle (  string  pathname,
float  scale
) 
 

A constructor.

Parameters:
pathname string argument defining path name.
scale is a float argument defining scale factor of the vehicle model. initalize path and scale factor of the vehicle model.

Definition at line 18 of file Vehicle.cpp.

References OSGWindows::getFrames(), TraffEduObject::objectGeode, TraffEduObject::objectGroup, TraffEduObject::objectPAT, TraffEduObject::objectPATvector, osgwind, TraffEduObject::setObjectType(), OSGWindows::sizeOfFrames(), and VEHICLE.


Member Function Documentation

void Vehicle::deletePath (   ) 
 

a normal member . delete the path of the vehicle

Definition at line 68 of file Vehicle.cpp.

References Path::deletePart(), and path.

Referenced by AnimationWindow::exit().

void Vehicle::displayPath (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. adds the path of the vehicle to the root.

Definition at line 55 of file Vehicle.cpp.

References TraffEduObject::display(), and path.

void Vehicle::draw (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
)  [virtual]
 

a normal member taking two arguments.

Parameters:
root is an osg::ref_ptr to osg::Group which the model node will be added.
animationFlag is an integer flag to specify whether the root is animation window root or not. this function adds the vehicle model node to the root.

Implements TraffEduObject.

Definition at line 38 of file Vehicle.cpp.

References TraffEduObject::addTree(), TraffEduObject::isBeforeCreated, TraffEduObject::modelPath, TraffEduObject::modelScale, TraffEduObject::objectGroup, TraffEduObject::returnNode(), TraffEduObject::setScale(), and TraffEduObject::viewMode.

void Vehicle::drawPath (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. calls draw function of Path object.

Definition at line 59 of file Vehicle.cpp.

References Path::draw(), and path.

Path * Vehicle::getPath (   ) 
 

a normal member .

Returns:
Path *. returns pointer to the path of the vehicle.

Definition at line 65 of file Vehicle.cpp.

References path.

Referenced by createAnimationPath(), AnimationWindow::createControlPoints(), AnimationWindow::createRotationArray(), and CarPhysics::mySetPosition().

void Vehicle::hidePath (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. removes the path of the vehicle from the root.

Definition at line 52 of file Vehicle.cpp.

References TraffEduObject::hide(), and path.

void Vehicle::reload (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
) 
 

a normal member taking two arguments .

Parameters:
root parameter is an osg::ref_ptr to osg::Group.
animationFlag is an integer flag to specify whether the vehicle the root is animation window root or not. in editor vehicle model will be the whole model(chasis+wheel together) in animation phase vehicle models will be re-loaded as wheels and chasis seperate this function removes the older node and reloads the newer(only chasis=kasa) model

Definition at line 72 of file Vehicle.cpp.

References TraffEduObject::modelScale, TraffEduObject::objectGroup, TraffEduObject::objectPAT, TraffEduObject::resetModelPath(), TraffEduObject::returnNode(), TraffEduObject::setScale(), and setWheels().

Referenced by AnimationWindow::exit().

void Vehicle::setPath (   ) 
 

Setter for the Path.

Definition at line 62 of file Vehicle.cpp.

void Vehicle::setPositionAll (  float  x,
float  y,
float  z
) 
 

a normal member .

Parameters:
x a float defining x coordinate.
y a float defining y coordinate.
z a float defining z coordinate. set position of all positionAttitudeTransform vectors of the vehicle.

Definition at line 109 of file Vehicle.cpp.

References osgwind, and OSGWindows::sizeOfFrames().

Referenced by CommandInsertVehicle::CommandInsertVehicle().

void Vehicle::setWheels (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. sets modelPath and scale factor of wheel objects of the vehicle.

Definition at line 96 of file Vehicle.cpp.

References Wheel::draw(), TraffEduObject::modelPath, TraffEduObject::modelScale, TraffEduObject::resetModelPath(), TraffEduObject::setModelPath(), TraffEduObject::setModelScale(), and wheelObjects.

Referenced by reload().


Member Data Documentation

Path Vehicle::path [private]
 

Definition at line 9 of file Vehicle.h.

Referenced by deletePath(), displayPath(), drawPath(), getPath(), and hidePath().

Wheel Vehicle::wheelObjects[4]
 

a public variable. vehicle has wheel objects, which are initiated at the begining of animation.

Definition at line 35 of file Vehicle.h.

Referenced by setWheels().


The documentation for this class was generated from the following files:
Generated on Sun May 28 18:54:15 2006 for TraffEdu by  doxygen 1.4.6-NO